home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Sample Code / Music Architecture / Embedding Instruments / BigEasy / IconUtilsPriv.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-07  |  8.6 KB  |  348 lines  |  [TEXT/MPS ]

  1.  
  2. #ifndef __ICONUTILSPRIV__
  3. #define __ICONUTILSPRIV__
  4.  
  5. #define labelColorBase    -16392
  6.  
  7. #ifndef REZ
  8.  
  9. #ifndef __TYPES__
  10. #include <Types.h>
  11. #endif
  12.  
  13. #ifndef __ICONS__
  14. #include <Icons.h>
  15. #endif
  16.  
  17. #ifndef __QUICKDRAW__
  18. #include <QuickDraw.h>
  19. #endif
  20.  
  21. #define genericIconBase                        -4000
  22. #define popupMenuSymbolResource                -3990
  23. #define standalonePopupMenuSymbolResource    -3986
  24.  
  25. #define genericMailboxIconResource            -3987    /* excise from 7.0 */
  26. #define genericLetterIconResource            -3988    /* excise from 7.0 */
  27.  
  28. #define noMaskFound        -1000                        /* error numbers */
  29. #define haltIterator    -1001
  30.  
  31. #define SUITE    0
  32. #define CACHE    1
  33.  
  34. enum
  35. {
  36.     largeIcon1 = 0,
  37.     largeIcon4,
  38.     largeIcon8,
  39.     smallIcon1,
  40.     smallIcon4,
  41.     smallIcon8,
  42.     miniIcon1,
  43.     miniIcon4,
  44.     miniIcon8,
  45.     aCIcon = 128
  46. };
  47.  
  48. typedef unsigned short IconType;
  49.  
  50. #define IconSpace (miniIcon8 + 1)
  51. #define IconDepthSpace (smallIcon1 - largeIcon1)
  52. #define IconSizeSpace (IconSpace / IconDepthSpace)
  53.  
  54. #define    transformMask 0x3
  55. #define labelMask 0x0f00
  56. #define labelShift 8
  57.  
  58. typedef pascal OSErr (*IconAction)(ResType theType, Handle *theIcon, void *yourDataPtr);
  59. typedef pascal Handle (*IconGetter)(ResType theType, void *yourDataPtr);
  60.  
  61. typedef struct
  62. {
  63.     unsigned short    type;
  64.     unsigned short    label;
  65.     Handle            table[IconSpace];
  66. } IconSuite;
  67.  
  68. typedef IconSuite *IconSuitePtr;
  69. typedef IconSuitePtr *IconSuiteHandle;
  70.  
  71. typedef struct
  72. {
  73.     IconSuite        theSuite;
  74.     void            *userPtr;
  75.     IconGetter        userMethod;
  76. } IconCache;
  77.  
  78. typedef    IconCache *IconCachePtr;
  79. typedef    IconCachePtr *IconCacheHandle;
  80.  
  81. #define Labels         8
  82. #define Sets        8
  83.  
  84. typedef struct
  85. {
  86.     GDHandle        theDevice;
  87.     long            theSeed;
  88.     unsigned long    checkMask,
  89.                     checkResults,
  90.                     disabledCheckMask,
  91.                     disabledCheckResults;
  92. } DeviceCheck;
  93.  
  94. typedef Handle Strings[Labels];
  95.  
  96. typedef struct
  97. {
  98.     Strings                labelStrings;
  99.     long                seeds[Labels * Sets];
  100.     CTabHandle            colorTables[Labels * Sets],
  101.                         originals[2];
  102.     RGBColor            labelColors[Labels];
  103.     unsigned char        **indexLists[2];
  104.     GDHandle            virtualScreen;
  105. #if TheFuture
  106.     GrafPtr                printerPortCache;
  107. #endif
  108.     long                deviceListSize;
  109.     DeviceCheck            deviceCheckList[1];
  110. } GlobalIconData;
  111.  
  112. typedef GlobalIconData    *GlobalIconDataPtr;
  113. typedef GlobalIconDataPtr *GlobalIconDataHandle;
  114.  
  115. /*  Selector mask values  */
  116. typedef unsigned long    IconSelectorValue;    
  117. #define svLarge1Bit            0x00000001
  118. #define svLarge4Bit            0x00000002
  119. #define svLarge8Bit            0x00000004
  120. #define svSmall1Bit            0x00000100
  121. #define svSmall4Bit            0x00000200
  122. #define svSmall8Bit            0x00000400
  123. #define svMini1Bit            0x00010000
  124. #define svMini4Bit            0x00020000
  125. #define svMini8Bit            0x00040000
  126. #define svAllLargeData        0x000000ff
  127. #define svAllSmallData        0x0000ff00
  128. #define svAllMiniData        0x00ff0000
  129. #define svAll1BitData        (svLarge1Bit | svSmall1Bit | svMini1Bit)
  130. #define svAll4BitData        (svLarge4Bit | svSmall4Bit | svMini4Bit)
  131. #define svAll8BitData        (svLarge8Bit | svSmall8Bit | svMini8Bit)
  132. #define svAllAvailableData    0xffffffff
  133.  
  134. /*  alignment type values  */
  135. typedef short    IconAlignmentType;    
  136. #define atNone                0x0
  137. #define atVerticalCenter    0x1
  138. #define atTop                0x2
  139. #define atBottom            0x3
  140. #define atHorizontalCenter    0x4
  141. #define atAbsoluteCenter    (atVerticalCenter | atHorizontalCenter)
  142. #define atCenterTop            (atTop | atHorizontalCenter)
  143. #define atCenterBottom        (atBottom | atHorizontalCenter)
  144. #define atLeft                0x8
  145. #define atCenterLeft        (atVerticalCenter | atLeft)
  146. #define atTopLeft            (atTop | atLeft)
  147. #define atBottomLeft        (atBottom | atLeft)
  148. #define atRight                0xC
  149. #define atCenterRight        (atVerticalCenter | atRight)
  150. #define atTopRight            (atTop | atRight)
  151. #define atBottomRight        (atBottom | atRight)
  152.  
  153.  
  154. /*  transform type values  */
  155. typedef short    IconTransformType;    
  156. #define    ttNone                0x0
  157. #define    ttDisabled            0x1
  158. #define    ttOffline            0x2
  159. #define ttOpen                0x3
  160. #define ttLabel1            0x0100
  161. #define ttLabel2            0x0200
  162. #define ttLabel3            0x0300
  163. #define ttLabel4            0x0400
  164. #define ttLabel5            0x0500
  165. #define ttLabel6            0x0600
  166. #define ttLabel7            0x0700
  167. #define    ttSelected            0x4000
  168. #define ttSelectedDisabled    (ttSelected | ttDisabled)
  169. #define    ttSelectedOffline    (ttSelected | ttOffline)
  170. #define ttSelectedOpen        (ttSelected | ttOpen)
  171.  
  172. #ifdef __cplusplus
  173. extern "C" {
  174. #endif
  175.  
  176. pascal OSErr PlotIconID(const Rect *theRect,
  177.                             IconAlignmentType align,
  178.                             IconTransformType transform,
  179.                             short theResID)
  180.     = {0x303C, 0x0500, 0xABC9};
  181.     
  182. pascal OSErr NewIconSuite(Handle *theIconSuite)
  183.     = {0x303C, 0x0207, 0xABC9};
  184.     
  185. pascal OSErr AddIconToSuite(Handle theIconData,
  186.                             Handle theSuite,
  187.                             ResType theType)
  188.     = {0x303C, 0x0608, 0xABC9};
  189.     
  190. pascal OSErr GetIconFromSuite(Handle *theIconData,
  191.                             Handle theSuite,
  192.                             ResType theType)
  193.     = {0x303C, 0x0609, 0xABC9};
  194.     
  195. pascal OSErr ForEachIconDo(Handle theSuite,
  196.                             IconSelectorValue selector,
  197.                             IconAction action,
  198.                             void *yourDataPtr)
  199.     = {0x303C, 0x080A, 0xABC9};
  200.     
  201. pascal OSErr GetIconSuite(Handle *theIconSuite,
  202.                             short theResID,
  203.                             IconSelectorValue selector)
  204.     = {0x303C, 0x0501, 0xABC9};
  205.     
  206. pascal OSErr DisposeIconSuite(Handle theIconSuite,
  207.                             Boolean disposeData)
  208.     = {0x303C, 0x0302, 0xABC9};
  209.     
  210. pascal OSErr PlotIconSuite(const Rect *theRect,
  211.                             IconAlignmentType align,
  212.                             IconTransformType transform,
  213.                             Handle theIconSuite)
  214.     = {0x303C, 0x0603, 0xABC9};
  215.     
  216. pascal OSErr MakeIconCache(Handle *theHandle,
  217.                             IconGetter makeIcon,
  218.                             void *yourDataPtr)
  219.     = {0x303C, 0x0604, 0xABC9};
  220.     
  221. pascal OSErr LoadIconCache(const Rect *theRect,
  222.                             IconAlignmentType align,
  223.                             IconTransformType transform,
  224.                             Handle theIconCache)
  225.     = {0x303C, 0x0606, 0xABC9};
  226.  
  227. pascal OSErr PlotIconMethod(const Rect *theRect,
  228.                             IconAlignmentType align,
  229.                             IconTransformType transform,
  230.                             IconGetter theMethod,
  231.                             void *yourDataPtr)
  232.     = {0x303C, 0x0805, 0xABC9};
  233.     
  234. pascal OSErr GetLabel(short labelNumber,
  235.                             RGBColor *labelColor,
  236.                             Str255 labelString)
  237.     = {0x303c, 0x050B, 0xABC9};
  238.     
  239. pascal Boolean PtInIconID(Point testPt,
  240.                             Rect *iconRect,
  241.                             IconAlignmentType alignment,
  242.                             short iconID)
  243.     = {0x303c, 0x060D, 0xABC9};
  244.     
  245. pascal Boolean PtInIconSuite(Point testPt,
  246.                             Rect *iconRect,
  247.                             IconAlignmentType alignment,
  248.                             Handle theIconSuite)
  249.     = {0x303c, 0x070E, 0xABC9};
  250.     
  251. pascal Boolean PtInIconMethod(Point testPt,
  252.                             Rect *iconRect,
  253.                             IconAlignmentType alignment,
  254.                             IconGetter theMethod,
  255.                             void *yourDataPtr)
  256.     = {0x303c, 0x090F, 0xABC9};
  257.     
  258. pascal Boolean RectInIconID(Rect *testRect,
  259.                             Rect *iconRect,
  260.                             IconAlignmentType alignment,
  261.                             short iconID)
  262.     = {0x303c, 0x0610, 0xABC9};
  263.     
  264. pascal Boolean RectInIconSuite(Rect *testRect,
  265.                             Rect *iconRect,
  266.                             IconAlignmentType alignment,
  267.                             Handle theIconSuite)
  268.     = {0x303c, 0x0711, 0xABC9};
  269.     
  270. pascal Boolean RectInIconMethod(Rect *testRect,
  271.                             Rect *iconRect,
  272.                             IconAlignmentType alignment,
  273.                             IconGetter theMethod,
  274.                             void *yourDataPtr)
  275.     = {0x303c, 0x0912, 0xABC9};
  276.     
  277. pascal OSErr IconIDToRgn(RgnHandle theRgn,
  278.                             Rect *iconRect,
  279.                             IconAlignmentType alignment,
  280.                             short iconID)
  281.     = {0x303c, 0x0613, 0xABC9};
  282.     
  283. pascal OSErr IconSuiteToRgn(RgnHandle theRgn,
  284.                             Rect *iconRect,
  285.                             IconAlignmentType alignment,
  286.                             Handle theIconSuite)
  287.     = {0x303c, 0x0714, 0xABC9};
  288.     
  289. pascal OSErr IconMethodToRgn(RgnHandle theRgn,
  290.                             Rect *iconRect,
  291.                             IconAlignmentType alignment,
  292.                             IconGetter theMethod,
  293.                             void *yourDataPtr)
  294.     = {0x303c, 0x0915, 0xABC9};
  295.     
  296. pascal OSErr SetSuiteLabel(Handle theSuite, short theLabel)
  297.     = {0x303C, 0x0316, 0xABC9};
  298.  
  299. pascal short GetSuiteLabel(Handle theSuite)
  300.     = {0x303C, 0x0217, 0xABC9};
  301.  
  302. pascal void SetIconDevice(GDHandle theScreen)
  303.     = {0x303C, 0x0218, 0xABC9};
  304.         
  305. pascal void GetIconDevice(GDHandle *theScreen)
  306.     = {0x303C, 0x0220, 0xABC9};
  307.     
  308. pascal OSErr GetIconCacheData(Handle theCache, void **theData)
  309.     = {0x303C, 0x0419, 0xABC9};
  310.         
  311. pascal OSErr SetIconCacheData(Handle theCache, void *theData)
  312.     = {0x303C, 0x041A, 0xABC9};
  313.         
  314. pascal OSErr GetIconCacheProc(Handle theCache, IconGetter *theProc)
  315.     = {0x303C, 0x041B, 0xABC9};
  316.         
  317. pascal OSErr SetIconCacheProc(Handle theCache, IconGetter theProc)
  318.     = {0x303C, 0x041C, 0xABC9};
  319.     
  320. pascal OSErr PlotIconHandle(const Rect *theRect,
  321.                             IconAlignmentType align,
  322.                             IconTransformType transform,
  323.                             Handle theIcon)
  324.     = {0x303C, 0x061D, 0xABC9};
  325.     
  326. pascal OSErr PlotSICNHandle(const Rect *theRect,
  327.                             IconAlignmentType align,
  328.                             IconTransformType transform,
  329.                             Handle theSICN)
  330.     = {0x303C, 0x061E, 0xABC9};
  331.     
  332. pascal OSErr PlotCIconHandle(const Rect *theRect,
  333.                             IconAlignmentType align,
  334.                             IconTransformType transform,
  335.                             CIconHandle theCIcon)
  336.     = {0x303C, 0x061F, 0xABC9};
  337.     
  338. pascal OSErr SetLabel(short labelNumber, const RGBColor *, ConstStr255Param)
  339.     = {0x303C, 0x050C, 0xABC9};
  340.  
  341. #ifdef __cplusplus
  342. }
  343. #endif
  344.  
  345. #endif    /*    #ifndef REZ    */
  346. #endif    /*    #ifndef __ICONUTILSPRIV__    */
  347.  
  348.